package edu.sctu.practice.class02.yangshengyu.assign02.test02;

/**
 * Created by Cullen on 2015/10/9.
 */
public class Rational{

    public int add (int a,int b){
            int c;
            c = a + b;
            return c;
    }

    public int sub(int a, int b) {
        int c;
        c = a - b;
        return c;
    }

    public int mult(int a, int b) {
        int c;
        c = a * b;
        return c;
    }

    public double div(int a, int b) {
        double c;
        double aDouble = (double) a;
        double bDouble = (double) b;
        c = (double) (aDouble / bDouble);
        return c;
    }

    public static void main(String[] args) {
        Rational objj = new Rational();

        System.out.println("5和2相加等于：" + objj.add(5, 2));

        System.out.println("5和2相减等于：" + objj.sub(5, 2));

        System.out.println("5和2相乘等于：" + objj.mult(5, 2));

        System.out.println("5和2相除等于：" + objj.div(5, 2));


    }
}

